package org.irri.smta.repository;

import java.util.List;

import javax.inject.Named;

import org.irri.smta.domain.Material;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

@Named("materialRepository")
public interface IMaterialRepository extends JpaRepository<Material, Long>, JpaSpecificationExecutor<Material> {

	@Transactional(readOnly = true)
	@Query("SELECT o FROM Material o ORDER BY o.id ASC")
	List<Material> findAllOrdered();
	
}
